SendCtlMsg is a short function included in the CyberDEFs package. When you license CyberDEF's, you'll receive C, Pascal and HyperTalk versions of its source code. Portions of our code can be pasted into your code in order to send your CDEFs the following messages.
Here are some messages you can send TextCDEF*:
NAME ID PURPOSE
--------------+---+-----------
SetText 256 Set all text to handle passed
GetSelect 257 Return handle to selection
GetText 258 Return handle to all text
Idle 261 Flash caret
Key 262 Passed char replaces selection
SetFont 265 Reset font to font number
SetFSize 266 Reset font size
FindStr 267 Select 1st occurance of string
FindStrWrap -267 Wrap-around find of string
FindWord 269 Find whole word; don't wrap
FindWordWrap -269 Wrap to find word
GetScroll 275 Set scrollbar & text
SetScroll -275 Return scroll position
Cut 277 Cut, put in clip & return text
Copy 278 Copy, clip & return text
Paste 279 Paste & update scroll
Clear 280 Clear & return text
Lock 512 Lock item's portion of screen
Unlock -512 Unlock screen
Resize 513 Resize & reset scroll, etc.
You'll probably want to send messages to TextCDEF on these events:
NAME ID ACTIVITY
----------+--+--------------
KeyDown 3 send chars to control with Key msg
NullEvent 0 send Idle msg to control
* As long as you are using text with less than 32767 chars, you can do to TextCDEF just about anything you can do to any other TextEdit field—with toolbox calls or manipulation of fields of the TE record.
**********
Here are some messages you can send PictCDEF:
NAME ID PURPOSE
-------+----+---------
SetPict 256 Set contents to handle passed
GetPict 257 Return handle to picture
**********
Here are the messages you can send ListCDEF:
NAME ID PURPOSE
------------+----+---------
SetText 256 Sets contents to text passed
GetSelect 257 Returns selection path
SetSelect 258 Changes text of selection
OpenAll 259 Expands all items
CloseAll 260 Collapses all items
CheckAll 261 Checks all items
UncheckAll 262 Unchecks all items
GetChecked 263 Returns paths of checked
ToggleSel 264 Toggles the selection's check
Key 265 Toggles the selection's check
SetSize 266 Set font size to value passed
GetPartCode 267 Returns partcode
CheckPath 268 Checks a line matching a path
UncheckPath -268 Unchecks a line
OpenPath 269 Opens a line matching a path
ClosePath -269 Closes a line matching a path
Resize 270 Resizes control to height & width
You'll probably want to send messages to ListCDEF on these events: